package com.shf.film.service.impl;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.shf.film.common.PageInfo;
import com.shf.film.common.PageSearchCondition;
import com.shf.film.dao.FilmDao;
import com.shf.film.exception.DAOException;
import com.shf.film.exception.ServiceException;
import com.shf.film.po.Film;
import com.shf.film.service.FilmService;

@SuppressWarnings("unchecked")
public class FilmServiceImpl extends ServiceImpl implements FilmService{
	
	private FilmDao filmDao;
	
	@Override
	public List<Film> getFilms() {
		return filmDao.findAll(Film.class);
	}

	public void setFilmDao(FilmDao filmDao) {
		this.filmDao = filmDao;
	}

	@Override
	public PageInfo getPageInfo(PageSearchCondition condition) throws ServiceException, DAOException{
		log.warn("取电影列表!");
		condition.parseCondtion();
		return filmDao.getPageInfo(condition);
	}

	@Override
	public void setLog() {
		this.log = LogFactory.getLog(FilmServiceImpl.class);
	}

}
